package com.neu.constant;

public enum MaterialTypeEnum {

    ARTICLE(10, "文章所属附件"),
    PROJECT(20, "项目所属生产资料"),
    UNKNOWN(-1, "未知");

    public final int type;
    public final String note;

    MaterialTypeEnum(int type, String note) {
        this.type = type;
        this.note = note;
    }

    public static MaterialTypeEnum of(int type) {
        if (type == ARTICLE.type) {
            return ARTICLE;
        } else if (type == PROJECT.type) {
            return PROJECT;
        } else {
            return UNKNOWN;
        }
    }

}
